package Demo7;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 洪汤泽大帅哥
 * Date: 2024-12-22
 * Time: 20:49
 */
import javax.xml.namespace.QName;
import java.util.*;
class Worker {
    private String name;
    private int age;
    private double salary;
    public Worker() { }
    public Worker(String name, int age,double salary){
        this.name = name;
        this.age=age;
        this.salary = salary;
    }
    public String getName() {
        return name;
    }
    public int getAge() {
        return age;
    }
    public double getSalary() {
        return salary;
    }
}
class WorkerList{
    public ArrayList<Worker> workers = new ArrayList<Worker>();
    public List<Worker> constructWorkerList(){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for (int i = 0; i < n; i++) {
            workers.add(readInWorker(sc.next(), sc.nextInt(), sc.nextDouble()));
        }
        return workers;
    }
    public Worker readInWorker(String name, int age,double salary) {
        return new Worker(name,age,salary);
    }
    public double computeTotalSalary(List<Worker> list){
        double sum = 0;
        for (int i = 0; i < workers.size(); i++) {
            sum += list.get(i).getSalary();
        }
        return sum;
    }
}

public class Main {
    public static void main(String[] args) {
        WorkerList app=new WorkerList();
        List<Worker> list=app.constructWorkerList();
        System.out.println(app.computeTotalSalary(list));
    }
}

/* 请在这里填写答案：将WorkerList类补充在这里 */
